home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / abrows1a / frmbrows.frm < prev    next >
Text File  |  1999-07-24  |  9KB  |  302 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "SHDOCVW.DLL"
  4. Begin VB.Form frmBrowser 
  5.    Caption         =   "Andrew's Web Browser"
  6.    ClientHeight    =   6135
  7.    ClientLeft      =   3060
  8.    ClientTop       =   3630
  9.    ClientWidth     =   7275
  10.    LinkTopic       =   "Form1"
  11.    Picture         =   "frmBrowser.frx":0000
  12.    ScaleHeight     =   6135
  13.    ScaleWidth      =   7275
  14.    ShowInTaskbar   =   0   'False
  15.    StartUpPosition =   1  'CenterOwner
  16.    Begin VB.Timer timTimer 
  17.       Enabled         =   0   'False
  18.       Interval        =   5
  19.       Left            =   6180
  20.       Top             =   1500
  21.    End
  22.    Begin VB.PictureBox picAddress 
  23.       Align           =   1  'Align Top
  24.       BorderStyle     =   0  'None
  25.       Height          =   675
  26.       Left            =   0
  27.       ScaleHeight     =   675
  28.       ScaleWidth      =   7275
  29.       TabIndex        =   3
  30.       TabStop         =   0   'False
  31.       Top             =   540
  32.       Width           =   7275
  33.       Begin VB.ComboBox cboAddress 
  34.          Height          =   315
  35.          Left            =   45
  36.          TabIndex        =   2
  37.          Text            =   "Type your URL here"
  38.          Top             =   300
  39.          Width           =   3795
  40.       End
  41.       Begin VB.Label lblAddress 
  42.          Caption         =   "&URL:"
  43.          Height          =   255
  44.          Left            =   45
  45.          TabIndex        =   1
  46.          Tag             =   "&Address:"
  47.          Top             =   60
  48.          Width           =   3075
  49.       End
  50.    End
  51.    Begin MSComctlLib.ImageList imlToolbarIcons 
  52.       Left            =   2670
  53.       Top             =   2325
  54.       _ExtentX        =   1005
  55.       _ExtentY        =   1005
  56.       BackColor       =   -2147483643
  57.       ImageWidth      =   24
  58.       ImageHeight     =   24
  59.       MaskColor       =   12632256
  60.       _Version        =   393216
  61.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  62.          NumListImages   =   6
  63.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  64.             Picture         =   "frmBrowser.frx":3FB2
  65.             Key             =   ""
  66.          EndProperty
  67.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  68.             Picture         =   "frmBrowser.frx":46C4
  69.             Key             =   ""
  70.          EndProperty
  71.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  72.             Picture         =   "frmBrowser.frx":4DD6
  73.             Key             =   ""
  74.          EndProperty
  75.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  76.             Picture         =   "frmBrowser.frx":54E8
  77.             Key             =   ""
  78.          EndProperty
  79.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  80.             Picture         =   "frmBrowser.frx":5BFA
  81.             Key             =   ""
  82.          EndProperty
  83.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  84.             Picture         =   "frmBrowser.frx":630C
  85.             Key             =   ""
  86.          EndProperty
  87.       EndProperty
  88.    End
  89.    Begin SHDocVwCtl.WebBrowser brwWebBrowser 
  90.       Height          =   3600
  91.       Left            =   0
  92.       TabIndex        =   0
  93.       Top             =   1440
  94.       Width           =   5640
  95.       ExtentX         =   9948
  96.       ExtentY         =   6350
  97.       ViewMode        =   1
  98.       Offline         =   0
  99.       Silent          =   0
  100.       RegisterAsBrowser=   0
  101.       RegisterAsDropTarget=   1
  102.       AutoArrange     =   -1  'True
  103.       NoClientEdge    =   0   'False
  104.       AlignLeft       =   0   'False
  105.       ViewID          =   "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
  106.       Location        =   ""
  107.    End
  108.    Begin MSComctlLib.Toolbar tbToolBar 
  109.       Align           =   1  'Align Top
  110.       Height          =   540
  111.       Left            =   0
  112.       TabIndex        =   4
  113.       Top             =   0
  114.       Width           =   7275
  115.       _ExtentX        =   12832
  116.       _ExtentY        =   953
  117.       ButtonWidth     =   1191
  118.       ButtonHeight    =   953
  119.       Style           =   1
  120.       _Version        =   393216
  121.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  122.          NumButtons      =   6
  123.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  124.             Caption         =   "Back"
  125.             Key             =   "Back"
  126.             Object.ToolTipText     =   "Back"
  127.          EndProperty
  128.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  129.             Caption         =   "Forward"
  130.             Key             =   "Forward"
  131.             Object.ToolTipText     =   "Forward"
  132.          EndProperty
  133.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  134.             Caption         =   "Stop"
  135.             Key             =   "Stop"
  136.             Object.ToolTipText     =   "Stop"
  137.          EndProperty
  138.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  139.             Caption         =   "Refresh"
  140.             Key             =   "Refresh"
  141.             Object.ToolTipText     =   "Refresh"
  142.          EndProperty
  143.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  144.             Caption         =   "Home"
  145.             Key             =   "Home"
  146.             Object.ToolTipText     =   "Home"
  147.          EndProperty
  148.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  149.             Caption         =   "Close"
  150.             Key             =   "Close"
  151.             Object.ToolTipText     =   "Close"
  152.          EndProperty
  153.       EndProperty
  154.       MousePointer    =   10
  155.       OLEDropMode     =   1
  156.    End
  157.    Begin VB.Menu File 
  158.       Caption         =   "&File"
  159.       Begin VB.Menu menu 
  160.          Caption         =   "-"
  161.          Index           =   1
  162.       End
  163.       Begin VB.Menu Exit 
  164.          Caption         =   "&Exit"
  165.       End
  166.    End
  167.    Begin VB.Menu Help 
  168.       Caption         =   "&Help"
  169.       Begin VB.Menu About 
  170.          Caption         =   "&About"
  171.       End
  172.    End
  173. End
  174. Attribute VB_Name = "frmBrowser"
  175. Attribute VB_GlobalNameSpace = False
  176. Attribute VB_Creatable = False
  177. Attribute VB_PredeclaredId = True
  178. Attribute VB_Exposed = False
  179. Public StartingAddress As String
  180. Dim mbDontNavigateNow As Boolean
  181.  
  182. Private Sub about_Click()
  183.     frmAbout.Show vbModal, Me
  184. End Sub
  185.  
  186.  
  187. Private Sub exit_Click()
  188.     Unload Me
  189. End Sub
  190.  
  191. Private Sub Form_Load()
  192.     On Error Resume Next
  193.     Me.Show
  194.     tbToolBar.Refresh
  195.     Form_Resize
  196.  
  197.  
  198.     cboAddress.Move 50, lblAddress.Top + lblAddress.Height + 15
  199.  
  200.  
  201.     If Len(StartingAddress) > 0 Then
  202.         cboAddress.Text = StartingAddress
  203.         cboAddress.AddItem cboAddress.Text
  204.         timTimer.Enabled = True
  205.         brwWebBrowser.Navigate StartingAddress
  206.  
  207.     End If
  208.  
  209.  
  210. End Sub
  211.  
  212.  
  213. Private Sub brwWebBrowser_DownloadComplete()
  214.     On Error Resume Next
  215.     Me.Caption = brwWebBrowser.LocationName
  216. End Sub
  217.  
  218.  
  219. Private Sub brwWebBrowser_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
  220.     On Error Resume Next
  221.     Dim i As Integer
  222.     Dim bFound As Boolean
  223.     Me.Caption = brwWebBrowser.LocationName
  224.     For i = 0 To cboAddress.ListCount - 1
  225.         If cboAddress.List(i) = brwWebBrowser.LocationURL Then
  226.             bFound = True
  227.             Exit For
  228.         End If
  229.     Next i
  230.     mbDontNavigateNow = True
  231.     If bFound Then
  232.         cboAddress.RemoveItem i
  233.     End If
  234.     cboAddress.AddItem brwWebBrowser.LocationURL, 0
  235.     cboAddress.ListIndex = 0
  236.     mbDontNavigateNow = False
  237. End Sub
  238.  
  239.  
  240. Private Sub cboAddress_Click()
  241.     If mbDontNavigateNow Then Exit Sub
  242.     timTimer.Enabled = True
  243.     brwWebBrowser.Navigate cboAddress.Text
  244. End Sub
  245.  
  246.  
  247. Private Sub cboAddress_KeyPress(KeyAscii As Integer)
  248.     On Error Resume Next
  249.     If KeyAscii = vbKeyReturn Then
  250.         cboAddress_Click
  251.     End If
  252. End Sub
  253.  
  254.  
  255. Private Sub Form_Resize()
  256.     On Error Resume Next
  257.     cboAddress.Width = Me.ScaleWidth - 100
  258.     b